package com.dd.ms.auth.utils.converter;

import com.dd.ms.auth.bo.UserInternalBO;
import com.dd.ms.auth.pojo.DO.UserDO;
import com.dd.ms.auth.vo.UserVO;
import org.springframework.beans.BeanUtils;

/**
 * @Author liuxianmeng
 * @CreateTime 2025/7/23 17:54
 * @Description 用户POJO转换器
 */
public class UserConverter {

    public static UserVO DO2VO(UserDO userDO) {
        if (userDO == null) {
            return null;
        }

        UserVO userVO = new UserVO();
        BeanUtils.copyProperties(userDO, userVO);
        return userVO;
    }

    public static UserInternalBO DO2BO(UserDO userDO) {
        if (userDO == null) {
            return null;
        }

        UserInternalBO userInternalBO = new UserInternalBO();
        BeanUtils.copyProperties(userDO, userInternalBO);
        return userInternalBO;
    }
}
